#ifndef GAMEMAINWINDOW_H
#define GAMEMAINWINDOW_H

#include <QWidget>
#include "EditorWidgets/dialogeditor.h"
#include "eventcenter.h"
#include <QWidget>
#include <QTimer>
#include <QTextDocument>
namespace Ui {
class GameMainWindow;
}

class GameMainWindow : public QWidget
{
    Q_OBJECT

public:
    explicit GameMainWindow(QWidget *parent = nullptr);
    ~GameMainWindow();
    void SetName(QString name);
    void SetDialogText(QString text);
    void resizeEvent(QResizeEvent *event);
protected:
    void mouseDoubleClickEvent(QMouseEvent *event);
private:
    Ui::GameMainWindow *ui;
    DialogEditor* editor = nullptr;
    QTimer *timer = nullptr;
    QString text = "";
    //每time毫秒跳出一个字
    int time = 50;
    void Init();
private slots:
    void ShowText();
};
#endif // GAMEMAINWINDOW_H
